﻿using System;
using System.ComponentModel;
using System.Runtime.InteropServices;

namespace Teigha.Core
{
	public class OdGeCompositeCurve2d : OdGeCurve2d
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public OdGeCompositeCurve2d(IntPtr cPtr, bool cMemoryOwn) : base(GlobalsPINVOKE.OdGeCompositeCurve2d_SWIGUpcast(cPtr), cMemoryOwn)
		{
			this.swigCPtr = new HandleRef(this, cPtr);
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public static HandleRef getCPtr(OdGeCompositeCurve2d obj)
		{
			if (obj != null)
			{
				return obj.swigCPtr;
			}
			return new HandleRef(null, IntPtr.Zero);
		}

		~OdGeCompositeCurve2d()
		{
			this.Dispose();
		}

		public override void Dispose()
		{
			if (this.swigCPtr.Handle != IntPtr.Zero)
			{
				if (this.swigCMemOwn)
				{
					lock (this.locker)
					{
						if (this.swigCPtr.Handle != IntPtr.Zero && this.swigCMemOwn)
						{
							this.swigCMemOwn = false;
							GlobalsPINVOKE.delete_OdGeCompositeCurve2d(this.swigCPtr);
						}
					}
					this.swigCMemOwn = false;
				}
				this.swigCPtr = new HandleRef(null, IntPtr.Zero);
			}
			GC.SuppressFinalize(this);
			base.Dispose();
		}

		public OdGeCompositeCurve2d() : this(GlobalsPINVOKE.new_OdGeCompositeCurve2d__SWIG_0(), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGeCompositeCurve2d(OdGeCompositeCurve2d source) : this(GlobalsPINVOKE.new_OdGeCompositeCurve2d__SWIG_1(OdGeCompositeCurve2d.getCPtr(source)), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGeCompositeCurve2d(OdGeCurve2dPtrArray curveList) : this(GlobalsPINVOKE.new_OdGeCompositeCurve2d__SWIG_2(OdGeCurve2dPtrArray.getCPtr(curveList)), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void getCurveList(OdGeCurve2dPtrArray curveList)
		{
			GlobalsPINVOKE.OdGeCompositeCurve2d_getCurveList(this.swigCPtr, OdGeCurve2dPtrArray.getCPtr(curveList));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGeCompositeCurve2d setCurveList(OdGeCurve2dPtrArray curveList)
		{
			OdGeCompositeCurve2d result = new OdGeCompositeCurve2d(GlobalsPINVOKE.OdGeCompositeCurve2d_setCurveList(this.swigCPtr, OdGeCurve2dPtrArray.getCPtr(curveList)), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public double globalToLocalParam(double param, out int crvNum)
		{
			double result = GlobalsPINVOKE.OdGeCompositeCurve2d_globalToLocalParam(this.swigCPtr, param, out crvNum);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public double localToGlobalParam(double param, int crvNum)
		{
			double result = GlobalsPINVOKE.OdGeCompositeCurve2d_localToGlobalParam(this.swigCPtr, param, crvNum);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeCompositeCurve2d Assign(OdGeCompositeCurve2d compCurve)
		{
			OdGeCompositeCurve2d result = new OdGeCompositeCurve2d(GlobalsPINVOKE.OdGeCompositeCurve2d_Assign(this.swigCPtr, OdGeCompositeCurve2d.getCPtr(compCurve)), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		private object locker = new object();

		private HandleRef swigCPtr;
	}
}
